<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<script>
$(document).ready(function(){
	$("input[id='submit_date']").attr("readonly",true);
});
</script>

<table class="t_css table01" width="100%" border="0" cellpadding="0" id="basicInfo"
	cellspacing="1">
	<col style="width:20%"/>
	<col style="width:15%"/>
	<col style="width:15%"/>
	<col style="width:20%"/>
	<col style="width:15%"/>
	<col style="width:15%"/>
	<tr class="li_1">
		<td   colspan="6" class="t_bar2">${param.title}</td>
		
	</tr>
	<tr class="li_2">
		<td   align="right" ><span class="color_red">*</span>项目名称：</td>
		<td  colspan="5">
			<input id="zh_title"  name="proposal/zh_title" label="${param.title}-->项目名称" type="text" required class="input_css required maxlength:100"  style="width:84%;" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />"/> 
		</td>
	</tr>
	<tr class="li_1">
		<td align="right">项目类型：</td>
		<td colspan="5">
		<c:set var="proposal_type_name"><x:out select="$xmlData/data/proposal/sub_grant_name" /></c:set>
		<span name="proposal/proposal_type_name">${proposal_type_name }</span>
		<c:if test="${proposal_type_name=='重点项目' }">
		<c:set var="proposal_type_value">02</c:set>
		</c:if>
		<c:if test="${proposal_type_name=='重大项目' }">
		<c:set var="proposal_type_value">03</c:set>
		</c:if>
		<input name="proposal/proposal_type_value" type="hidden" value="${proposal_type_value }"/>
		</td>
	</tr>
	<tr class="li_2">
		<td align="right"><span class="color_red">*</span>发明专利名称：</td>
		<td colspan="2">
		<input id="utility_patent_name" name="proposal/utility_patent_name" label="${param.title}-->发明专利名称" type="text" required class="input_css required maxlength:100"  style="width:135px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/utility_patent_name" />"/> 
		</td>
		<td align="right"><span class="color_red">*</span>申报日期：</td>
		<td colspan="2">
		<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className="gray required date" label="${param.title}-->申报日期"></cpt:date> 
		</td>
	</tr>
	<tr class="li_1">
		<td align="right"><span class="color_red">*</span>发明专利号：</td>
		<td colspan="2">
		<input id="utility_patent_value" maxlength="50" name="proposal/utility_patent_value" label="${param.title}-->发明专利号" type="text"  required class="input_css required" style="width:135px"  value="<x:out select="$xmlData/data/proposal/utility_patent_value" />"/> 
		</td>
		<td  align="right" ><span class="color_red">*</span>授权日期：</td>
		<td colspan="2">
			<c:set var="accredit_date"><x:out select="$xmlData/data/proposal/accredit_date" /></c:set>
			<cpt:date id="accredit_date" name="proposal/accredit_date" value="${accredit_date}" className=" required date" label="${param.title}-->授权日期"></cpt:date> 
		</td>
	</tr>
	<tr class="li_2">
		<td align="right"><span class="color_red">*</span>所属十大战略新兴产业类别：</td>
		<td  colspan="2" >
			  <c:set var="grantCode"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
			<c:set var="sub"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
			<c:set var="researcharea_all_value"><x:out select="$xmlData/data/proposal/researcharea_all_value" /></c:set>
			<c:set var="researcharea">{'id':'<x:out select="$xmlData/data/proposal/researcharea_all_value" />','name':'<x:out select="$xmlData/data/proposal/researcharea_all_name" />'}</c:set>
			<c:if test="${empty researcharea_all_value }"><c:set var="researcharea">{'id':'<x:out select="$xmlData/data/proposal/researcharea_value" />','name':'<x:out select="$xmlData/data/proposal/researcharea_name" />'}</c:set></c:if>
          	<cpt:tree key="researcharea1" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${researcharea}"  label="${param.title}-->所属十大战略新兴产业类别"
          		id="researcharea" onlyChooseLeaf="true" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="localInitTreeValue" sqlParamVal="{grant_code:${sub},stat_year:${param.statYear }}"/>
	        <input id="researcharea_value" type="hidden" name="proposal/researcharea_value" class="required" label="${param.title}-->所属十大战略新兴产业类别" value="<x:out select="$xmlData/data/proposal/researcharea_value" />"/>
            <input id="researcharea_name" type="hidden" name="proposal/researcharea_name"  value="<x:out select="$xmlData/data/proposal/researcharea_name" />"/>
             <input id="researcharea_all_name" type="hidden" name="proposal/researcharea_all_name"  value="<x:out select="$xmlData/data/proposal/researcharea_all_name" />"/>
			 <input  type="hidden" id="researcharea_all_value" name="proposal/researcharea_all_value"  value="<x:out select="$xmlData/data/proposal/researcharea_all_value" />"/>
		
		</td>
		<td align="right"><span class="color_red">*</span>所属学科：</td>
		<td  colspan="2" width="30%">
          	<c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />','name':'<x:out select="$xmlData/data/proposal/subject_name" />'}</c:set>
          	<cpt:tree key="medically" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${subject}"  label="${param.title}-->所属学科"
          		id="subject" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2" />
	        <input id="subject_code" type="hidden" name="proposal/subject_code" class="required" label="${param.title}-->所属学科" value="<x:out select="$xmlData/data/proposal/subject_code" />"/>
            <input id="subject_name" type="hidden" name="proposal/subject_name"  value="<x:out select="$xmlData/data/proposal/subject_name" />"/>
		</td>
		
	</table>
	<br/>
<script type="text/javascript">
  function setZhTitle(obj){
	  $("#intro_zh_title").text($(obj).val());
  }
  function localInitTreeValue(treeId, treeNode) {
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			return false;
		}
		var showName = "";
		var parentId="";
		if (obj != null) {
		    str = obj.name + "-" + str;
			//obj = obj.parentNode;
			showName = obj.name;
			parentId=obj.id;
		//	$("#" + treeId).parents("tr").find("[name$='domain_value']").val(treeNode.id);
		//	$("#" + treeId).parents("tr").find("[name$='subject_no']").val(str.split("_")[1]);
		//	$("#" + treeId).parents("tr").find("[name$='domain_name']").text(treeNode.name.split("_")[0]);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(parentId);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(showName);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name'],[id$='" + treeId + "_all_name']").val(str);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_value'],[id$='" + treeId + "_all_value']").val(treeNode.id);
		}else{
			//$("#"+treeId).parents("tr").find("[name$='domain_value']").val("");
			//$("#"+treeId).parents("tr").find("[name$='subject_no']").val("");
		  //  $("#"+treeId).parents("tr").find("[name$='domain_name']").text("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name'],[id$='" + treeId + "_all_name']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_value'],[id$='" + treeId + "_all_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		}
		$("#" + treeId).val(str);
}
function setEmptyValueForTree(id){
	   // $("#"+id).parents("tr").find("[name$='domain_value']").val("");
	//	$("#"+id).parents("tr").find("[name$='subject_no']").val("");
	//	$("#"+id).parents("tr").find("[name$='domain_name']").text("");
		$("#" + id).parents("td").find("[name$='" + id + "_all_name'],[id$='" + id + "_all_name']").val("");
		$("#" + id).parents("td").find("[name$='" + id + "_all_value'],[id$='" + id + "_all_value']").val("");
		$("#"+id).val("");
		$("#"+id+"_hideId").val("");
		$("#"+id+"_hideName").val("");
		$("#"+id+"_code").val("");
		$("#"+id+"_value").val("");
		$("#"+id+"_name").val("");
		$("#"+id + ",[name$='/"+id+"_code']" + ",[name$='/"+id+"_name'],[name$='/"+id+"_value']").val("");
	}
</script>
